﻿@model Webs.Models.TransactionModel
@if (ViewBag.ErrMsg != null)
{
    <div id="dErrMsg" class="ui-state-error ui-corner-all" style="margin-top: 5px; padding: 5px;
        font-size: .9em;">
        <p style="vertical-align: top; margin: 0; padding: 0;">
            <span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span>
            <strong>@ViewBag.ErrMsg</strong>
        </p>
        <div style="margin-left: 23px;">@Html.ValidationSummary(false, "Please correct the errors and try again:")</div>
    </div>
}
@if (ViewBag.SuccMsg != null)
{
    <div id="dSuccMsg" class="ui-state-highlight ui-corner-all" style="margin-top: 5px;
        padding: 5px; font-size: .9em;">
        <p style="vertical-align: top; margin: 0; padding: 0;">
            <span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
            <strong>@ViewBag.SuccMsg</strong>
        </p>
    </div>
}
@Html.HiddenFor(m => m.TransactionID)
<div class="editor-label">
    @TransactionRes.TransactionString.DATE @Html.ValidationMessageFor(m => m.TransactionDate)
</div>
<div class="editor-field">
    @Html.TextBoxFor(m => m.TransactionDate, new { Class = "editor-field-col" })
</div>
<div class="editor-label">
    @TransactionRes.TransactionString.CUSTOMER @Html.ValidationMessageFor(m => m.CooperaterID)
</div>
<div class="editor-field">
    <select style="width: 310px">
        <option>Long son</option>
        <option>RABELINK</option>
        <option>MARO FORWARDING </option>
    </select>
</div>
<div class="editor-label">
</div>
<table border="0" cellpadding="0" cellspacing="0" class="list-table">
    <tr>
        <th class="first" width="50px">
            @SharedRes.SharedString.No
        </th>
        <th width="250px">
            @TransactionRes.TransactionString.ITEM
        </th>
        <th width="180px">
            @TransactionRes.TransactionString.AMOUNT
        </th>
        <th>
        </th>
    </tr>
    <tr>
        <td class="first right">
            1
        </td>
        <td>
            Van chuyen
        </td>
        <td class="right">
            800.000
        </td>
        <td class="last">
            <a href="#" class="lnkBtn">
                @SharedRes.SharedString.Edit
            </a><a href="#" class="lnkBtn" style="margin-top: 5px">
                @SharedRes.SharedString.Delete
            </a>
        </td>
    </tr>
    <tr>
        <td class="first right">
            2
        </td>
        <td>
            kho bai
        </td>
        <td class="right">
            300.000
        </td>
        <td class="last">
            <a href="#" class="lnkBtn">
                @SharedRes.SharedString.Edit
            </a><a href="#" class="lnkBtn" style="margin-top: 5px">
                @SharedRes.SharedString.Delete
            </a>
        </td>
    </tr>
    <tr>
        <td class="first right" colspan="2">
            @TransactionRes.TransactionString.TOTAL
        </td>
        <td class="right">
            <b>800.000</b>
        </td>
        <td class="last">
        </td>
    </tr>
</table>
<div class="editor-label">
</div>
<input type="button" id="btnSubmit" class="btn" value="@SharedRes.SharedString.Save" />
@*@if (Model != null)
    {
        <input type="button" id="btnDetail" class="btn" value="@SharedRes.SharedString.Detail" style="margin-left: 5px" />  
    }*@
<input type="button" id="btnDetail" class="btn" value="@SharedRes.SharedString.Detail" style="margin-left: 5px" />
<div id="dPayDetail">
    @Html.Partial("_Detail")
</div>
<script type="text/javascript">
    $(document).ready(function () {

        $("#TransactionDate").datepicker({ dateFormat: 'dd/mm/yy' });

        $("#btnSubmit").click(function () {
            document.getElementById("frmPay").submit();
        });

        $("#dPayDetail").dialog({
            autoOpen: false,
            title: "@TransactionRes.TransactionString.RECEIPTDETAIL",
            width: 350,
            height: 250,
            modal: true,
            resizable: false,
            buttons: [{
                text: "@SharedRes.SharedString.Save",
                click: function () {
                    $(this).dialog("close");
                }
            }, {
                text: "Cancel",
                click: function () {
                    $(this).dialog("close");
                }
            }]
        });

        $('#btnDetail').click(function () {
            $('#dPayDetail').dialog('open');
            return false;
        });
    });    //ready
</script>
